/*
 * @Author: Leo.wang wanglizhigs@163.com
 * @Date: 2024-09-03 21:58:29
 * @LastEditors: Leo.wang wanglizhigs@163.com
 * @LastEditTime: 2024-09-03 22:49:04
 * @FilePath: /metaverse-manage/app/entity/Model.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import dayjs from 'dayjs';
import { objKeyTransfer, MEANS } from '../utils/convention';

export interface Model {
  id: number;
  name: string;
  path: string;
  mesh: string;
  remark: string;
  type: string;
  create_time: string;
  update_time: string;
}


export function initModel(data = {}) {
  const time = dayjs().format('YYYY-MM-DD HH:mm:ss');
  return objKeyTransfer({
    name: '',
    path: '',
    mesh: '',
    create_time: time,
    update_time: time,
    ...data,
  }, MEANS.CamelToSnake);
}

export function updateModel(data = {}) {
  const time = dayjs().format('YYYY-MM-DD HH:mm:ss');
  return objKeyTransfer({
    update_time: time,
    ...data,
  }, MEANS.CamelToSnake);
}
